import Vue from 'vue'
import Router from 'vue-router'
import MovieIndex from '@/components/MovieIndex';
import UserLogin from '@/components/UserLogin';
import VideoPlayer from '@/components/commons/VideoPlayer';
import page404 from '@/components/error/404';
import page500 from '@/components/error/500';
import Test from '@/components/Test';
import Index from '@/components/MyPages/Index';
import MyCollection from '@/components/MyPages/MyCollection';
import MyOrders from '@/components/MyPages/MyOrders';
import MyInfo from '@/components/MyPages/MyInfo';

Vue.use(Router)

export default new Router({
  routes: [
    {path: '/',name: 'MovieIndex',component: MovieIndex,
      // 重定向
      redirect:{path: '/miswuIndex',name: 'Index',component: Index},    
      // 子路由   
      children:[
        {path: '/miswuIndex',name: 'Index',component: Index},
        {path: '/myCollectionCenter',name: 'MyCollection',component: MyCollection},
        {path: '/myOrdersCenter',name: 'MyOrders',component: MyOrders},
        {path: '/myInfoCenter',name: 'MyInfo',component: MyInfo},
      ]
    },
    {path: '/UserLogin',name: 'UserLogin',component: UserLogin},
    {path: '/VideoPlayer',name: 'VideoPlayer',component: VideoPlayer},
    {path: '/404',name: 'page404',component: page404},
    {path: '/500',name: 'page500',component: page500},
    {path: '/Test',name: 'Test',component: Test},
  ]
})
